package com.yiqi.liebang.feature.mine.view;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.suozhang.framework.component.recyclerview.DividerItemDecoration;
import com.suozhang.framework.framework.BaseActivity;
import com.suozhang.framework.utils.T;
import com.yiqi.liebang.R;
import com.yiqi.liebang.entity.bo.RewardBo;
import com.yiqi.liebang.entity.bo.RewardContentBo;
import com.yiqi.liebang.feature.mine.view.adapter.RewardAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class InfluenceRewardActivity extends BaseActivity {


    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.rv_reward)
    RecyclerView mRvReward;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_influence_reward;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initView() {
        initToolBar(mToolbar, "影响力奖励", true, true);
        mRvReward.setLayoutManager(new LinearLayoutManager(this));
        mRvReward.addItemDecoration(new DividerItemDecoration(DividerItemDecoration.VERTICAL).setHeight(2));
        try {
            RewardAdapter rewardAdapter = new RewardAdapter(getStringsData());
            mRvReward.setAdapter(rewardAdapter);
            rewardAdapter.expandAll();
        }catch (Exception e){
            T.showShort(e.getMessage());
        }

    }

    @Override
    protected void initData() {

    }



    private List<MultiItemEntity> getStringsData() {
        List<MultiItemEntity> itemEntities = new ArrayList<>();
        List<RewardBo> listList = new ArrayList<>();
        List<RewardContentBo> stringList = new ArrayList<>();
        stringList.add(new RewardContentBo("新手机注册用户+50"));
        stringList.add(new RewardContentBo("授权腾讯微信或新浪微博新注册用户+30"));
        stringList.add(new RewardContentBo("用户登陆APP+10/每天"));
        stringList.add(new RewardContentBo("个人基本信息认证通过+50"));
        stringList.add(new RewardContentBo("职业经历名片认证通过+30/每次"));
        stringList.add(new RewardContentBo("职业经历在职证明认证通过+30/每次"));
        stringList.add(new RewardContentBo("职业经历营业执照认证通过+30/每次"));
        stringList.add(new RewardContentBo("职业经历工牌认证通过+30/每次"));
        stringList.add(new RewardContentBo("教育经历学位证认证通过+50"));
        stringList.add(new RewardContentBo("教育经历毕业证认证通过+50"));
        stringList.add(new RewardContentBo("机构申请通过+50"));
        stringList.add(new RewardContentBo("主动加他人为好友人脉通过+10/每人"));
        stringList.add(new RewardContentBo("通过他人好友人脉申请+10/每人"));
        stringList.add(new RewardContentBo("发布话题商品+50/每次"));
        stringList.add(new RewardContentBo("学员确认服务完成+50/每次"));
        stringList.add(new RewardContentBo("行家确认服务完成+50/每次"));
        stringList.add(new RewardContentBo("回答他人在线提问+30/每次"));
        stringList.add(new RewardContentBo("被他人喜欢+10/每次"));
        stringList.add(new RewardContentBo("被他人点评/好评+20/每次"));
        stringList.add(new RewardContentBo("被他人认可职业标签+10/每次"));
        stringList.add(new RewardContentBo("付费预约行家+50/每次"));
        stringList.add(new RewardContentBo("绑定微信/支付宝账户成功+50"));
        stringList.add(new RewardContentBo("个人话题被他人分享到微信好友/朋友圈/QQ/微博好友+50/每次"));
        stringList.add(new RewardContentBo("个人名片被他人分享到微信好友/朋友圈/QQ/微博好友+50/每次"));
        stringList.add(new RewardContentBo("分享他人的话题到微信好友/朋友圈/QQ/微博好友+100/每次"));
        stringList.add(new RewardContentBo("分享他人的名片到微信好友/朋友圈/QQ/微博好友+100/每次"));
        List<RewardContentBo> stringList2 = new ArrayList<>();
        stringList2.add(new RewardContentBo("被解除好友关系-30"));
        stringList2.add(new RewardContentBo("被屏蔽拉黑-20"));
        stringList2.add(new RewardContentBo("因违规被限时冻结账号-100"));
        stringList2.add(new RewardContentBo("因违规被冻结账户-影响力清O"));
        stringList2.add(new RewardContentBo("未按约定时间而擅自爽约-50"));
        stringList2.add(new RewardContentBo("未按约定时间而擅自爽约并退款-50"));
        stringList2.add(new RewardContentBo("恶意给他人点评/差评-100"));
        listList.add(0, new RewardBo("影响力奖励的加分规则是什么？", stringList));
        listList.add(1, new RewardBo("影响力奖励的减分规则是什么？", stringList2));

        for (int i = 0; i < listList.size(); i++) {
            RewardBo rewardBo = listList.get(i);
            for (int j = 0; j < rewardBo.getStringList().size(); j++) {
                RewardContentBo rewardContentBo = rewardBo.getStringList().get(j);
                rewardBo.addSubItem(rewardContentBo);
            }
            itemEntities.add(rewardBo);
        }

        return itemEntities;
    }

}
